<template>
  <div class="table-box">
    <el-table
        :data="ecards"
        border
        style="width: 100%;height: 500px">
      <el-table-column
          prop="id"
          label="编号"
          width="280"
          align="center">
      </el-table-column>
      <el-table-column
          label="照片"
          width="100"
          align="center">
        <template slot-scope="scope">
          <img :src="scope.row.eimg" style="height: 50px"/>
        </template>
      </el-table-column>
      <el-table-column
          prop="ename"
          label="姓名"
          width="80"
          align="center">
      </el-table-column>
      <el-table-column
          prop="egender"
          label="性别"
          width="50"
          align="center">
      </el-table-column>
      <el-table-column
          prop="email"
          label="E-mail"
          width="200"
          align="center">
      </el-table-column>
      <el-table-column
          prop="eteachOffice"
          label="联系地址"
          width="400"
          align="center">
      </el-table-column>
      <el-table-column
          prop="eprofessionalTitle"
          label="职称"
          width="100"
          align="center">
      </el-table-column>
      <el-table-column
          label="操作"
          width="200"
          align="center">
        <template slot-scope="scope" >
          <el-button @click="updatecard(scope.row.id)" type="text" size="small">审核</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div>
      <el-pagination
          background
          @current-change="handleCurrentChange"
          :page-size='6'
          layout="total, prev, pager, next"
          :total=total
          style="display: flex;justify-content: flex-end;margin-top: 30px;margin-right: 10%"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
import {queryvcardbycid,queryunauditcard} from "@/api/vcard";

export default {
  name: "auditManage",
  data() {
    return {
      total: null,
      ecards:[],
      isflag: false,
    };
  },
  created() {
    this.getcardData(1);
  },
  methods: {
    handleCurrentChange(current){
      this.getcardData(current)
    },
    updatecard(eid) {
      this.$router.push({
        name: 'editCard',
        query: {
          eid: eid,
        }
      });
    },
    getcardData(current) {
      queryunauditcard(current, 5).then(response => {
        console.log(response.result.records);
        this.ecards = response.result.records
        this.total = response.result.total
      })
    },
  }
}
</script>

<style scoped>

</style>